#include "GameMain.h"

CCAnimate *GameOther::getAnimate(int id,char *state)
{
	CCAnimation *animation = CCAnimation::create();

	CCTexture2D *texture = GameLoader::sharedGameLoader()->getTexture2d(strcat((char *)id,state));
	for (int i = 0; i < 4; i++)
	{
		CCSpriteFrame *frame = CCSpriteFrame::createWithTexture(texture,CCRectMake(i * 100,0,100,100));
		animation->addSpriteFrame(frame);
	}

	CCAnimate *animate = CCAnimate::create(animation);
	return animate;
}

CCPoint GameOther::getViewPoint(int x,int y)
{
	CCPoint point = CCPointMake(GameMain::sharedGameMain()->getBgLayer()->getMapTileWidth() * x,GameMain::sharedGameMain()->getBgLayer()->getMapContentHeight() - GameMain::sharedGameMain()->getBgLayer()->getMapTileHeight() * y);
	return point;
}